package com.mebs.model;

import org.jt.jet.content.JetNamedObject;
import com.mebs.model.service.accommodation.AccommodationUnitType;
import com.mebs.model.service.commercial.CommercialType;
import com.mebs.model.service.visa.VisaType;

/**
 * Date: Mar 27, 2006
 * Time: 6:08:06 PM
 *
 * @author Peschuk Ruslan
 */
public enum ServiceType implements JetNamedObject {
    ACCOMMODATION(1, "Accommodation Type", AccommodationUnitType.class),
    COMMERCIAL(2, "Commercial Type", CommercialType.class),
    VISA(3, "Visa Type", VisaType.class);

    public final int type;
    public final String name;
    public final Class typeClass;

    ServiceType(int type, String name, Class typeClass)
    {
        this.type = type;
        this.name = name;
        this.typeClass = typeClass;
    }

    public static ServiceType getObjectByType(int type)
    {
        return ServiceType.values()[type - 1];
    }

    public Object getObjectId()
    {
        return type;
    }

    public String getObjectName()
    {
        return name;
    }

    public int getObjectType()
    {
        return type;
    }

    public Class getTypeClass()
    {
        return typeClass;
    }

    public String toString()
    {
        return name;
    }
}
